import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '分析项目',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '单位',
    align: "center",
    dataIndex: 'unit'
  },
  {
    title: '阈值最小值',
    align: "center",
    dataIndex: 'minValue'
  },
  {
    title: '阈值最大值',
    align: "center",
    dataIndex: 'maxValue'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "分析项目",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '分析项目',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入分析项目!'},
             ];
    },
  },
  {
    label: '单位',
    field: 'unit',
    component: 'Input',
  },
  {
    label: '阈值最小值',
    field: 'minValue',
    component: 'InputNumber',
  },
  {
    label: '阈值最大值',
    field: 'maxValue',
    component: 'InputNumber',
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "yn"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '分析项目',order: 0,view: 'text', type: 'string',},
  unit: {title: '单位',order: 1,view: 'text', type: 'string',},
  minValue: {title: '阈值最小值',order: 2,view: 'number', type: 'number',},
  maxValue: {title: '阈值最大值',order: 3,view: 'number', type: 'number',},
  status: {title: '状态',order: 4,view: 'radio', type: 'string',},
};
